function PhotoGallery()
{
	this.PhotoData;
	this.Width;
	this.Height;
	this.SelectedPhotoId;
	this.Title;

	// Databinding for property PhotoData
	this.SetPhotoData = function(data)
	{
		///UserCodeRegionStart:[SetPhotoData] (do not remove this comment.)

     
			this.PhotoData = data; 
    
		
		
		
		
		
		///UserCodeRegionEnd: (do not remove this comment.)
	}

	// Databinding for property PhotoData
	this.GetPhotoData = function()
	{
		///UserCodeRegionStart:[GetPhotoData] (do not remove this comment.)


		return this.PhotoData;
		
		
		
		
		
		
		
		
		
		
		///UserCodeRegionEnd: (do not remove this comment.)
	}

	this.show = function()
	{
		///UserCodeRegionStart:[show] (do not remove this comment.)

		if (!this.ControlCreated)
		{
			this.createMySilverlightControl(); 
			this.ControlCreated = true;		      
		}
		else
		{
		    //this.UpdateCurrentImage();
		}		
		
		
		
		
		
		
		
		
		
		
		
		
		///UserCodeRegionEnd: (do not remove this comment.)
	}
	///UserCodeRegionStart:[User Functions] (do not remove this comment.)


	this.createMySilverlightControl = function()
 	{
	    	var scene = new photoGalleryWall.Page(this.PhotoData,this);
 			
        	Silverlight.createObjectEx({
          		source: gx.util.resourceUrl(gx.basePath + gx.staticDirectory + 'PhotoGallery/Page.xaml', true),
      	    	parentElement: this.getContainerControl(),
      		    id: "SilverlightControl",
      		    properties: {
       			    width: this.Width,
       			    height: this.Height,
                    framerate:'24',
       			    version: "0.9"
      		    },
      		    events: {
       			    onLoad: Silverlight.createDelegate(this, this.handleLoad)
      		    }
     	    });
    }       

    this.handleLoad = function(control, userContext, rootElement)
    {
        //myEllipse
        rootElement.findName("galleryTitleText").Text = this.Title;
				
				for (var i=0; i<PhotoData.length; i++) 
				{
					if (i < 10) {
						imageName = "image0" + i;
					}
					else {
						imageName = "image" + i;
					}
					rootElement.findName(imageName).addEventListener("MouseLeftButtonDown",displayImage);
					
					//PhotoGallery.SelectedPhotoId = PhotoData[imageNumber].Id;
					//rootElement.findName(imageName).addEventListener("MouseLeftButtonDown",this.PhotoChanged);
	
					rootElement.findName(imageName).addEventListener("MouseEnter",showOutline);
					rootElement.findName(imageName).addEventListener("MouseLeave",hideOutline);
					
				}
  	}
	
	Silverlight.createDelegate = function(instance, method) {
	    return function() {return method.apply(instance, arguments);}
    }		
	
	
	
	
	
	
	
	
	///UserCodeRegionEnd: (do not remove this comment.):
}
